﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IOBusiness;
using IOEntity;

namespace Indochinaodyssey.UserControl.BookTour
{
    public partial class ucBookThisHotel : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            lblTitle.Text = Request.QueryString["name"];
            lblHotelName.Text = Request.QueryString["name"];
        }

        protected void btnSendH_Click(object sender, EventArgs e)
        {
            clsTemHotel t = new clsTemHotel();
            t.Hotel = Request.QueryString["name"];
            t.Mr = cbxGender.SelectedValue;
            t.Name = txtName.Value;
            t.Email = txtEmail.Value;
            t.Add = txtAddress.Value;
            t.Country = txtCountry.Value;
            t.National = "Viet nam";
            t.Phone = txtPhone.Value;
            t.City = txtCity.Value;
            t.Arrival = datepicker.Value;
            t.Dep = datepicker2.Value;
            t.Roomtype = cbxRoomType.SelectedValue;
            t.OtherRoom = txtOtherRoom.Value;
            t.Bed = cbxBed.SelectedValue;
            t.OtherBed = txtOtherBed.Value;
            t.NumberOfRoom = txtNumberOfRom.Value;
            t.NumberOfAdults = txtNumOfAdults.Value;
            t.NumberOfChilds = txtNumOfChild.Value;
            t.FlightNo = txtFilghtNo.Value;
            t.Arrivaltime = txtArrivalTiem.Value;
            t.Comment = txtComment.Value;
            t.National = txtNation.Value;
            clsBSGetHTMLHotel h = new clsBSGetHTMLHotel();
            string[] to = { "namlh@tantinh.net" };
            if (clsBSSendMail.sendMail(to, "Booking tour", h.getHTML(Request.PhysicalApplicationPath + "/HTMLPageTempHotel.htm", t)))
	        {
                Response.Redirect("thank-you-contact.aspx");
	        }   
            
        }
    }
}